package com.acsior.hibernate.vo;

import static javax.persistence.InheritanceType.JOINED;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;

/**
 * OrderService entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "order_services", uniqueConstraints = @UniqueConstraint(columnNames = "barcode"))
@Inheritance(strategy = JOINED)
@GeneratorKey(tableName = "service_requests")
public class OrderServiceVO extends ServiceRequestVO {

	private static final long serialVersionUID = 9201034886823926074L;

	@Column(name = "bank_order", nullable = false)
	private boolean bankOrder;

	@Column(name = "barcode", unique = true, nullable = false, length = 20)
	private String barcode;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id")
	private CustomerVO customer;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "recipient_customer_id", nullable = false)
	private CustomerVO customerByRecipientCustomer;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sender_customer_id", nullable = false)
	private CustomerVO customerBySenderCustomer;

	@Column(name = "group_locked", nullable = false)
	private boolean groupLocked;

	@Column(name = "group_serial_number", nullable = false)
	private Integer groupSerialNumber;

	@Column(name = "incoming", nullable = false)
	private boolean incoming;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_country_id", nullable = false)
	private NomCountryVO nomCountry;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_currency_id", nullable = false)
	private NomCurrencyVO nomCurrency;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_not_pay_reason_id")
	private NomNotPayReasonVO nomNotPayReason;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_official_order_type_id")
	private NomOfficialOrderTypeVO nomOfficialOrderType;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_order_service_type_id", nullable = false)
	private NomOrderServiceTypeVO nomOrderServiceType;

	@Column(name = "not_pay_reason_info")
	private String notPayReasonInfo;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_bank_group_id")
	private OrderGroupVO orderBankGroup;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "orderService")
	private List<OrderInvitationVO> orderInvitations;

	@Column(name = "order_reason")
	private String orderReason;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "paid_employee_id")
	private EmployeeVO paidEmployee;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "paid_structure_id")
	private StructureVO paidStructure;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "postman_payment_id")
	private PostmanPaymentVO postmanPayment;

	@Column(name = "receive_date", length = 23)
	private Date receiveDate;

	@Column(name = "remark")
	private String remark;

	@Column(name = "transfer_amount", nullable = false, scale = 4)
	private double transferAmount;

	/** default constructor */
	public OrderServiceVO() {
		this.orderInvitations = new ArrayList<OrderInvitationVO>();
	}

	/** @return the barcode */
	public String getBarcode() {
		return this.barcode;
	}

	/** @return the customer */
	public CustomerVO getCustomer() {
		return this.customer;
	}

	/** @return the customerByRecipientCustomer */
	public CustomerVO getCustomerByRecipientCustomer() {
		return this.customerByRecipientCustomer;
	}

	/** @return the customerBySenderCustomer */
	public CustomerVO getCustomerBySenderCustomer() {
		return this.customerBySenderCustomer;
	}

	/** @return the groupSerialNumber */
	public Integer getGroupSerialNumber() {
		return this.groupSerialNumber;
	}

	/** @return the nomCountry */
	public NomCountryVO getNomCountry() {
		return this.nomCountry;
	}

	/** @return the nomCurrency */
	public NomCurrencyVO getNomCurrency() {
		return this.nomCurrency;
	}

	/** @return the nomNotPayReason */
	public NomNotPayReasonVO getNomNotPayReason() {
		return this.nomNotPayReason;
	}

	/** @return the nomOfficialOrderType */
	public NomOfficialOrderTypeVO getNomOfficialOrderType() {
		return this.nomOfficialOrderType;
	}

	/** @return the nomOrderServiceType */
	public NomOrderServiceTypeVO getNomOrderServiceType() {
		return this.nomOrderServiceType;
	}

	/** @return the notPayReasonInfo */
	public String getNotPayReasonInfo() {
		return this.notPayReasonInfo;
	}

	/** @return the orderBankGroup */
	public OrderGroupVO getOrderBankGroup() {
		return this.orderBankGroup;
	}

	/** @return the orderInvitations */
	public List<OrderInvitationVO> getOrderInvitations() {
		return this.orderInvitations;
	}

	/** @return the orderReason */
	public String getOrderReason() {
		return this.orderReason;
	}

	/** @return the paidEmployee */
	public EmployeeVO getPaidEmployee() {
		return this.paidEmployee;
	}

	/** @return the paidStructure */
	public StructureVO getPaidStructure() {
		return this.paidStructure;
	}

	/** @return the postmanPayment */
	public PostmanPaymentVO getPostmanPayment() {
		return this.postmanPayment;
	}

	/** @return the receiveDate */
	public Date getReceiveDate() {
		return this.receiveDate;
	}

	/** @return the remark */
	public String getRemark() {
		return this.remark;
	}

	/** @return the transferAmount */
	public double getTransferAmount() {
		return this.transferAmount;
	}

	/** @return the bankOrder */
	public boolean isBankOrder() {
		return this.bankOrder;
	}

	/** @return the groupLocked */
	public boolean isGroupLocked() {
		return this.groupLocked;
	}

	/** @return the incoming */
	public boolean isIncoming() {
		return this.incoming;
	}

	/** @param bankOrder */
	public void setBankOrder(boolean bankOrder) {
		this.bankOrder = bankOrder;
	}

	/** @param barcode */
	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}

	/** @param customer */
	public void setCustomer(CustomerVO customer) {
		this.customer = customer;
	}

	/** @param customerByRecipientCustomer */
	public void setCustomerByRecipientCustomer(CustomerVO customerByRecipientCustomer) {
		this.customerByRecipientCustomer = customerByRecipientCustomer;
	}

	/** @param customerBySenderCustomer */
	public void setCustomerBySenderCustomer(CustomerVO customerBySenderCustomer) {
		this.customerBySenderCustomer = customerBySenderCustomer;
	}

	/** @param groupLocked */
	public void setGroupLocked(boolean groupLocked) {
		this.groupLocked = groupLocked;
	}

	/** @param groupSerialNumber */
	public void setGroupSerialNumber(Integer groupSerialNumber) {
		this.groupSerialNumber = groupSerialNumber;
	}

	/** @param incoming */
	public void setIncoming(boolean incoming) {
		this.incoming = incoming;
	}

	/** @param nomCountry */
	public void setNomCountry(NomCountryVO nomCountry) {
		this.nomCountry = nomCountry;
	}

	/** @param nomCurrency */
	public void setNomCurrency(NomCurrencyVO nomCurrency) {
		this.nomCurrency = nomCurrency;
	}

	/** @param nomNotPayReason */
	public void setNomNotPayReason(NomNotPayReasonVO nomNotPayReason) {
		this.nomNotPayReason = nomNotPayReason;
	}

	/** @param nomOfficialOrderType */
	public void setNomOfficialOrderType(NomOfficialOrderTypeVO nomOfficialOrderType) {
		this.nomOfficialOrderType = nomOfficialOrderType;
	}

	/** @param nomOrderServiceType */
	public void setNomOrderServiceType(NomOrderServiceTypeVO nomOrderServiceType) {
		this.nomOrderServiceType = nomOrderServiceType;
	}

	/** @param notPayReasonInfo */
	public void setNotPayReasonInfo(String notPayReasonInfo) {
		this.notPayReasonInfo = notPayReasonInfo;
	}

	/** @param orderBankGroup */
	public void setOrderBankGroup(OrderGroupVO orderBankGroup) {
		this.orderBankGroup = orderBankGroup;
	}

	/** @param orderInvitations */
	public void setOrderInvitations(List<OrderInvitationVO> orderInvitations) {
		this.orderInvitations = orderInvitations;
	}

	/** @param orderReason */
	public void setOrderReason(String orderReason) {
		this.orderReason = orderReason;
	}

	/** @param paidEmployee */
	public void setPaidEmployee(EmployeeVO paidEmployee) {
		this.paidEmployee = paidEmployee;
	}

	/** @param paidStructure */
	public void setPaidStructure(StructureVO paidStructure) {
		this.paidStructure = paidStructure;
	}

	/** @param postmanPayment */
	public void setPostmanPayment(PostmanPaymentVO postmanPayment) {
		this.postmanPayment = postmanPayment;
	}

	/** @param receiveDate */
	public void setReceiveDate(Date receiveDate) {
		this.receiveDate = receiveDate;
	}

	/** @param remark */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/** @param transferAmount */
	public void setTransferAmount(double transferAmount) {
		this.transferAmount = transferAmount;
	}

}